@echo off
setlocal
set logfile=%StartupLogs%\ScheduleClearIISLogs.log

echo %date% %time% >> %logfile% 2>&1
echo %cd% >> %logfile% 2>&1
echo Advanced Log Location: %LogLocation% >> %logfile% 2>&1

schtasks /Create /F /RU "NT AUTHORITY\SYSTEM" /SC DAILY /MO 1 /TN ClearIISLogs /TR "PowerShell.exe -ExecutionPolicy Unrestricted -Command '& %cd%\Startup\RemoveIISLogs.ps1 %LogLocation% '" >> %logfile% 2>&1

exit /b 0

